<html>
<body>
<script language=JavaScript>
function closeIt() {
close();
}
</script>
<?php
require("../config.php");

if($_SESSION['login'] != "" && $_SESSION['pass'] != ""){
  $login = $_SESSION['login'];
  $name = $_POST['name'];
  $link = $_POST['link'];
  $query = "INSERT INTO links VALUES('$login','$name','$link')";
  $result = mysql_query($query);
  //echo "Your link saved. <form><input onclick=closeIt() type=button value=Close></form>";
  echo "Your link saved. <a hef=index.php>Back</a>";
  mysql_close();

};
?>
</body>
</html>
